//
//  UIView+ViewController.m
//  linktuIOS
//
//  Created by 俊松何 on 2017/3/14.
//  Copyright © 2017年 tianxie. All rights reserved.
//

#import "UIView+ViewController.h"

@implementation UIView (ViewController)
-(UIViewController *)currentViewController
{
    for (UIView* next = [self superview]; next; next = next.superview) {
        UIResponder* nextResponder = [next nextResponder];
        if ([nextResponder isKindOfClass:[UIViewController class]]) {
            return (UIViewController*)nextResponder;
        }
    }
    return nil;

}
@end
